<?php
class GameStatusAction extends SzAbstractAction {

    protected $paramTypes = array(
        SzAbstractAction::TYPE_INT
    );

    public function execute($userId) {
        $token = SzParam::getReqParam('token');
        $old_token = SzContextFactory::get()->getStaticCache($userId)->get(GameConst::CACHE_KEY_TOKEN . $userId);
        $data = array();
        if ($token != $old_token) {
            $data = array(
                'token' => $old_token
            );
        }

        return $this->buildResponse(
            $data
        );
    }
}